import serveUrl from "@/config/serverAddress"; // 接口域名列表
import axios from "@/config/http"; // 导入http中创建的axios实例

const optionsManage = {
  //  * @api{property} 获取选项类型
  GetEnumType(params) {
    return axios.get(`${serveUrl.rs}/EnumMetaData/GetEnumType`, { params });
  },
  //  * @api{property} 获取选项列表
  GetEnumData(params) {
    return axios.get(`${serveUrl.rs}/EnumMetaData/Page`, { params });
  },
  //  * @api{property} 修改选项启用状态
  EditEnumDataStatus(params) {
    return axios.post(`${serveUrl.rs}/EnumMetaData/EditEnumDataStatus`, params);
  },
  //  * @api{property} 获取选项类型
  EnumMetaData(params) {
    return axios.delete(`${serveUrl.rs}/EnumMetaData`, { params });
  },
  //  * @api{property} 添加选项
  Install(params) {
    return axios.post(`${serveUrl.rs}/EnumMetaData/Install`, params);
  },
  //  * @api{property} 获取选项列表
  GetEnumDataOptiont(params) {
    return axios.get(`${serveUrl.rs}/EnumMetaData/GetEnumDataOptiont`, { params });
  },

  //  * @api{property} 人事异动列表
  GetChangePage(params) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/GetChangePage`, params);
  },

  //  * @api{property} 转正列表   optionsManage
  GetBecomePage(params, data) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/GetBecomePage?type=${data}`, params);
  },

  //  * @api{property} 入职列表
  GetEntryPage(params, data) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/GetEntryPage?type=${data}`, params);
  },

  //  * @api{property} 离职列表
  GetLeavePage(params, data) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/GetLeavePage?type=${data}`, params);
  },

  //  * @api{property} 调动列表
  GetTransferPage(params, data) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/GetTransferPage?type=${data}`, params);
  },

  //  * @api{property} 员工关怀列表
  EmployeePage(params) {
    return axios.post(`${serveUrl.rs}/Employee/Page`, params);
  },

  //  * @api{property} 修改人员状态
  EditEmployeeState(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/EditEmployeeState`, params);
  },

  //  * @api{property} 上传
  uploadOssFile(params, data) {
    return axios.post(`${serveUrl.cs}/Common/uploadOssFile?fileTypeName=${data.fileTypeName}`, params);
  },

  /**
   * @api{property} 办理入职
   */
  InsertEmployeeEntry(params) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/InsertEmployeeEntry`, params);
  },

  /**
   * @api{property} 确认入职
   */
  ConfirmEmployeeEntry(params, employeeId) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/ConfirmEmployeeEntry?employeeId=${employeeId}`, params);
  },

  /**
   * @api{property} 办理离职
   */
  InsertEmployeeLeave(params) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/InsertEmployeeLeave`, params);
  },

  /**
   * @api{property} 重新入职
   */
  AgainEntry(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/AgainEntry?employeeId=${params.employeeId}`);
  },

  /**
   * @api{property} 取消离职
   */
  UnConfirmLeave(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/UnConfirmLeave?employeeId=${params.employeeId}`);
  },

  /**
   * @api{property} 取消离职
   */
  ConfirmEmployeeLeave(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/ConfirmEmployeeLeave?employeeId=${params.employeeId}`);
  },

  /**
   * @api{property} 办理调动
   */
  InsertEmployeeTransfer(params) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/InsertEmployeeTransfer`, params);
  },

  //  * @api{property} 确认调动
  ConfirmTransfer(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/ConfirmTransfer?employeeTransferId=${params.EmployeeTransferId}`);
  },

  /**
   * @api{property} 取消调动
   */
  UnConfirmTransfer(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/UnConfirmTransfer?employeeTransferId=${params.EmployeeTransferId}`);
  },

  /**
   * @api{property} 办理转正
   */
  InsertEmployeeRegular(params) {
    return axios.post(`${serveUrl.rs}/ExamineApprove/InsertEmployeeRegular`, params);
  },

  /**
   * @api{property} 确认转正
   */
  ConfirmEmployeeRegular(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/ConfirmEmployeeRegular?employeeId=${params.employeeId}`);
  },

  //  * @api{property} 查询在职员工
  GetEmployeeRegularSelect(params) {
    return axios.get(`${serveUrl.rs}/ExamineApprove/GetEmployeeRegularSelect`, { params });
  },

  //  * @api{property} 办理离职员工选择列表
  GetEmployeeAwaitLeaveSelect(params) {
    return axios.get(`${serveUrl.rs}/ExamineApprove/GetEmployeeAwaitLeaveSelect`, { params });
  },

  //  * @api{property} 办理转正员工选择列表
  GetEmployeeProbationPeriodSelect(params) {
    return axios.get(`${serveUrl.rs}/ExamineApprove/GetEmployeeProbationPeriodSelect`, { params });
  },

  //  * @api{property} 获取员工入职基本信息
  GetEmployeeBasicRegister(params) {
    return axios.get(`${serveUrl.rs}/ExamineApprove/GetEmployeeBasicRegister`, { params });
  },

  //  * @api{property} 放弃入职
  UnConfirmEntry(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/UnConfirmEntry?employeeId=${params.employeeId}`);
  },

  //  * @api{property} 转回待入职
  BackAwaitEntry(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/BackAwaitEntry?employeeId=${params.employeeId}`);
  },

  //  * @api{property} 获取人事提醒
  GetPersonnelWarn(params) {
    return axios.get(`${serveUrl.rs}/PersonelWorkbench/GetPersonnelWarn`, { params });
  },

  //  * @api{property} 获取人事概况
  GetPersonnelGeneralSituation(params) {
    return axios.get(`${serveUrl.rs}/PersonelWorkbench/GetPersonnelGeneralSituation`, { params });
  },

  //  * @api{property} 按日期获取员工生日信息
  GetEmployeeBirthDayByTime(params) {
    return axios.get(`${serveUrl.rs}/PersonelWorkbench/GetEmployeeBirthDayByTime`, { params });
  },

  //  * @api{property} 人事提醒详情
  GetPersonnelWarnDetail(params) {
    return axios.get(`${serveUrl.rs}/PersonelWorkbench/GetPersonnelWarnDetail`, { params });
  },

  //  * @api{property} 员工关怀
  GetEmployeeCarePage(params) {
    return axios.post(`${serveUrl.rs}/Employee/GetEmployeeCarePage`, params);
  },

  //  * @api{property} 配置模板
  GetSmsTemplateSetting(params) {
    return axios.get(`${serveUrl.rs}/Employee/GetSmsTemplateSetting`, { params });
  },

  //  * @api{property} 转回待入职
  EditSmsTemplate(params) {
    return axios.put(`${serveUrl.rs}/Employee/EditSmsTemplate?Enable=${params.Enable}&templateId=${params.templateId}`);
  },

  //  * @api{property} 获取合同模板分页
  GetPage(params) {
    return axios.get(`${serveUrl.rs}/ContractTemplate/GetPage`, { params });
  },

  //  * @api{property} 删除模板
  DelContractTemplate(params) {
    return axios.delete(`${serveUrl.rs}/ContractTemplate`, { params });
  },

  //  * @api{property} word转html
  GetHtmlByImportWord(params) {
    return axios.post(`${serveUrl.rs}/ContractTemplate/GetHtmlByImportWord`, params);
  },

  //  * @api{property} 添加模板
  AddContractTemplate(params) {
    return axios.post(`${serveUrl.rs}/ContractTemplate`, params);
  },

  //  * @api{property} 合同分页
  GetPageContract(params, type) {
    return axios.post(`${serveUrl.rs}/EmployeeContract/${type == 1 ? "GetPage" : "GetPageNotSign"}`, params);
  },

  //  * @api{property} 解除合同
  CancelContract(params) {
    return axios.put(`${serveUrl.rs}/EmployeeContract/CancelContract?EmployeeModuleId=${params.EmployeeModuleId}`);
  },

  //  * @api{property} 合同模板替换字段
  GetAllEnableModuleField(params) {
    return axios.get(`${serveUrl.rs}/FieldExtension/GetAllEnableModuleField`, { params });
  },

  //  * @api{property} 修改模板启用状态
  EditEnableStart(params) {
    return axios.put(`${serveUrl.rs}/ContractTemplate/EditEnableStart/${params.contractTemplateId}?isEnable=${params.isEnable}`);
  },

  //  * @api{property} 模板详情
  GetTemplateContent(params) {
    return axios.get(`${serveUrl.rs}/ContractTemplate/GetTemplateContent/${params.templateId}`);
  },

  //  * @api{property} 获取合同文件
  GetElectronicContract(params) {
    return axios.get(`${serveUrl.rs}/EmployeeContract/GetElectronicContract`, { params });
  },

  //  * @api{property} 空合同模板
  GetEmpty(params) {
    return axios.get(`${serveUrl.rs}/EmployeeContract/GetEmpty`, { params });
  },

  //  * @api{property} 添加合同
  EmployeeContract(params, EmployeeId) {
    return axios.post(`${serveUrl.rs}/EmployeeContract?EmployeeId=${EmployeeId}`, params);
  },

  //  * @api{property} 合同模板下拉
  GetSelectTemplate(params) {
    return axios.get(`${serveUrl.rs}/ContractTemplate/GetSelectTemplate`, { params });
  },

  //  * @api{property} 修改模板启用状态
  EditTemplate(params, templateId) {
    return axios.put(`${serveUrl.rs}/${templateId}`, params);
  },

  //  * @api{property} 获取合同信息
  GetEmployeeContract(params) {
    return axios.get(`${serveUrl.rs}/EmployeeContract`, { params });
  },

  //  * @api{property} 电子签章
  SignContract(params) {
    return axios.post(`${serveUrl.rs}/EmployeeContract/SignContract`, params);
  },

  //  * @api{property} 获取员工字段值列表
  GetContractFieldList(params) {
    return axios.get(`${serveUrl.rs}/EmployeeContract/GetContractFieldList`, { params });
  },

  //  * @api{property} 获取员工字段值列表
  GetEmployeePost(params) {
    return axios.get(`${serveUrl.rs}/Employee/GetEmployeePost`, { params });
  },

  //  * @api{property} 导出员工数据
  Exprot(params, type) {
    return axios.post(`${serveUrl.rs}/Employee/Exprot`, params, { responseType: "blob" });
  },

  //  * @api{property} 导入员工数据
  Import(params, type) {
    return axios.post(`${serveUrl.rs}/Employee/Import`, params);
  },

  //  * @api{property} 获取员工导入模板
  GetImportTemplate(params) {
    // return axios.get(`${serveUrl.rs}/Employee/GetImportTemplate`, { params }, { responseType: 'blob' });
    return axios({
      method: "GET",
      url: `${serveUrl.rs}/Employee/GetImportTemplate`,
      params: params,
      responseType: "blob",
    });
  },

  //  * @api{property} 即将入职列表
  GetEntryList(params) {
    return axios.get(`${serveUrl.rs}/PersonelWorkbench/GetEntryList`, { params });
  },

  //  * @api{property} 即将离职列表
  GetLeaveList(params) {
    return axios.get(`${serveUrl.rs}/PersonelWorkbench/GetLeaveList`, { params });
  },

  //  * @api{property} 分列导入lie
  GetPartImportColunms(params) {
    return axios.get(`${serveUrl.rs}/Employee/GetPartImportColunms`, { params });
  },

  //  * @api{property} 分列导入模板
  GetPartImportTemplate(params) {
    // return axios.post(`${serveUrl.rs}/Employee/GetPartImportTemplate`, params);
    return axios({
      method: "POST",
      url: `${serveUrl.rs}/Employee/GetPartImportTemplate`,
      data: params,
      responseType: "blob",
    });
  },

  //  * @api{property} 分列导入模板
  PartImport(params) {
    return axios.post(`${serveUrl.rs}/Employee/PartImport`, params);
  },

  //  * @api{property} 获取审批表单
  GetApproveFormId(params) {
    return axios.get(`${serveUrl.rs}/ExamineApprove/GetApproveFormId`, { params });
  },

  //  * @api{property} 获取显示列配置
  GetColumnStyleSetting(params) {
    return axios.get(`${serveUrl.rs}/PersonnelChangeTablestyleSetting/GetColumnStyleSetting`, { params });
  },

  //  * @api{property} 获取审批表单
  PersonnelChangeTablestyleSetting(type, params) {
    return axios.put(`${serveUrl.rs}/PersonnelChangeTablestyleSetting?type=${type}`, params);
  },

  //  * @api{property} 修改员工
  EditEmployee(params, employeeId) {
    return axios.put(`${serveUrl.rs}/Employee?employeeId=${employeeId}`, params);
  },

  //  * @api{property} 获取小程序二维码
  GetQRCodeUnlimited(params) {
    return axios.post(`${serveUrl.rs}/WeChat/GetQRCodeUnlimited?employeeId=${params.employeeId}`);
  },

  // /FinancialManager/GetCompanyRelatedData
  GetCompanyRelatedData(params) {
    return axios.post(`${serveUrl.cs}/FinancialManager/GetCompanyRelatedData`, params);
  },

  // /FinancialManager/GetCompanyRelatedData
  LoginEnterprise(params) {
    return axios.get(`${serveUrl.cs}/FinancialManager/LoginEnterprise`, { params });
  },

  // /FinancialManager/GetCompanyRelatedData
  RegAuthCode(params) {
    return axios.get(`${serveUrl.cs}/FinancialManager/RegAuthCode`, { params });
  },

  IDCardFrontOCR(params) {
    return axios.post(`${serveUrl.rs}/CommonOcr/IDCardFrontOCR`, params);
  },

  BankCardOCR(params) {
    return axios.post(`${serveUrl.rs}/CommonOcr/BankCardOCR`, params);
  },

  AddEmployeeLeaveTemplate(params) {
    return axios.post(`${serveUrl.rs}/EmployeeProveTemplate`, params);
  },

  GetEmployeeLeaveTemplate(params) {
    return axios.get(`${serveUrl.rs}/EmployeeProveTemplate`, { params });
  },

  EditEmployeeLeaveTemplate(query, params) {
    return axios.put(`${serveUrl.rs}/EmployeeProveTemplate?templateId=${query.templateId}`, params);
  },

  DeleteEmployeeLeaveTemplate(params) {
    return axios.delete(`${serveUrl.rs}/EmployeeProveTemplate`, { params });
  },

  GetPageTemplate(params) {
    return axios.get(`${serveUrl.rs}/EmployeeProveTemplate/GetPage`, { params });
  },

  GetEmployeeClassStatistics(params) {
    return axios.get(`${serveUrl.rs}/Employee/GetEmployeeClassStatistics`, { params });
  },

  GetSelect(params) {
    return axios.get(`${serveUrl.rs}/EmployeeProveTemplate/GetSelect`, { params });
  },

  GetEmployeeTree(params) {
    return axios.get(`${serveUrl.rs}/employee_prove_record/GetEmployeeTree`, { params });
  },

  AddProve(params) {
    return axios.post(`${serveUrl.rs}/employee_prove_record`, params);
  },

  Export(params) {
    // return axios.get(`${serveUrl.rs}/employee_prove_record/Export/${params.batch}`);
    return axios({
      method: "GET",
      url: `${serveUrl.rs}/employee_prove_record/Export/${params.batch}`,
      // responseType: 'blob'
    });
  },
  GetEmployeesColumnsInfo(params) {
    return axios.post(`${serveUrl.rs}/employee_prove_record/GetEmployeesColumnsInfo`, params);
  },

  /**
   * 取消转正
   * @param {*} params
   * @returns
   */
  UnConfirmEmployeeRegular(params) {
    return axios.put(`${serveUrl.rs}/ExamineApprove/UnConfirmEmployeeRegular?becomRegularId=${params.becomRegularId}`);
  },

  /**
   * 获取网络图片base64信息
   * @param {*} params
   * @returns
   */
  GetImageBase64(params) {
    return axios.get(`${serveUrl.rs}/Upload/GetImageBase64`, { params });
  },
  

  /**
   * 获取子公司部门树(匿名访问)
   * @param {*} params
   * @returns
   */
  GetDepartmentTree(params) {
    return axios.get(`${serveUrl.rs}/Employee/GetDepartmentTree`, { params });
  },
};

export default optionsManage;
